#ifndef CAPUTERCAPDATA_H
#define CAPUTERCAPDATA_H
#include <pcap.h>
#include <stdlib.h>
#include <time.h>
#include "PcapExceptions.h"


#define PCAPCAPUTERSIZE 65535

namespace Pacap {

typedef void (*GetCaputerHander)(u_char *user,const struct pcap_pkthdr *h,const u_char *bytes);



class CaputerCapData
{
public:
    enum ProToCol : uint8_t
    {
        ToColCUD = 0x00,
    };

    CaputerCapData()=default;
    virtual ~CaputerCapData()=default;
public:
   // init pcap
    void initPcap(std::string networkCard,std::string filterStr);
    //set callback
    void setPcapLoop(GetCaputerHander getCaputerData);
    //close pcap
    void closePcap();
private:
    //init networkcard
    void __initNetWorkCard(std::string networkCard,std::string filterStr);
private:
    pcap_t *pcap;
};

}
#endif // CAPUTERCAPDATA_H
